package com.zhu.ecology;

/**
 * Created by DELL on 2016/2/1.
 */
public class SignTimeOfInOrUp {

    public static void main(String[] args){
        String username = null;
        String pwd = null;
        String timeType = "1";
        if(args.length > 0){
            timeType = args[0];
        }

        Sign s = new Sign();

        if(args.length > 1){
            s.setUserName(args[1]);
        }

        if(args.length > 2){
            s.setPassword(args[2]);
        }

        String result = Sign.SIGN_IN.equals(timeType)? s.getSignInTimeOfToday():s.getSignUpTimeOfToday();
        System.out.println(" --------------[" + s.getUserName() + "]---------------");
        System.out.println(" --------------------------------------");
        System.out.print("|\t");
        String signStr = Sign.SIGN_IN.equals(timeType)? "签到时间" :"签退时间";
        if(result == null) {
            System.out.print("未查询到" + signStr);
        }else{
            System.out.print("今日" + signStr + "：" + result);
        }
        System.out.println("\t|");
        System.out.println(" --------------------------------------");
    }
}
